package com.itheima.example15;

public class Example14 {
    public static void main(String[] args) {
        Sheep s=new Sheep();
        animalCall(s);
    }

    public static void animalCall(Animal a) {
        if (a instanceof Cow){
            Cow c =(Cow)a;
            c.call();
        }else{
            System.out.println("这个动物不是牛!");
        }
        
    }
}
